package com.happy016.service.base.impl;


import com.happy016.persist.base.IBaseDao;
import com.happy016.service.base.IBaseService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author linyb
 * create on 2017/6/19 13:55
 */
public class BaseServiceImpl<T,K> implements IBaseService<T,K> {

    @Autowired
    private IBaseDao<T,K> baseDao;

    @Override
    public Integer save(T entity) {
        return baseDao.save(entity);
    }

    @Override
    public Integer saveSelective(T entity) {
        return baseDao.saveSelective(entity);
    }

    @Override
    public Integer saveUseGeneratedKeys(T entity) {
        return baseDao.saveUseGeneratedKeys(entity);
    }

    @Override
    public Integer delete(K id) {
        return baseDao.delete(id);
    }

    @Override
    public Integer deleteByEntity(T entity) {
        return baseDao.deleteByEntity(entity);
    }

    @Override
    public Integer update(T entity) {
        return baseDao.update(entity);
    }

    @Override
    public Integer updateSelective(T entity) {
        return baseDao.updateSelective(entity);
    }

    @Override
    public T get(K id) {
        return baseDao.get(id);
    }

    @Override
    public List<T> findAll() {
        return baseDao.findAll();
    }

    @Override
    public List<T> findAllByEntity(T entity) {
        return baseDao.findAllByEntity(entity);
    }

    @Override
    public T findOneByEntity(T entity) {
        return baseDao.findOneByEntity(entity);
    }

    @Override
    public Integer findCountByEntity(T entity) {
        return baseDao.findCountByEntity(entity);
    }

    @Override
    public List<T> findByIds(String ids) {
        return baseDao.findByIds(ids);
    }

    @Override
    public Integer deleteByIds(String ids) {
        return baseDao.deleteByIds(ids);
    }

    @Override
    public Integer saveList(List<T> entitys) {
        return baseDao.saveList(entitys);
    }
}
